// 自动生成模板PluginUsageStats
package plugin_market

import (
	"gitcode.com/G-YT/ANN/server/global"
	"time"
)

// 插件使用统计 结构体  PluginUsageStats
type PluginUsageStats struct {
	global.GVA_MODEL
	UserId         *int       `json:"user_id" form:"user_id" gorm:"index;comment:用户ID;column:user_id;" binding:"required"`           //用户ID
	PluginId       *int       `json:"plugin_id" form:"plugin_id" gorm:"index;comment:插件ID;column:plugin_id;" binding:"required"`     //插件ID
	AccessCount    *int       `json:"access_count" form:"access_count" gorm:"default:0;comment:访问次数;column:access_count;"`           //访问次数
	UsageDuration  *int       `json:"usage_duration" form:"usage_duration" gorm:"default:0;comment:使用时长(分钟);column:usage_duration;"` //使用时长
	LastAccessTime *time.Time `json:"last_access_time" form:"last_access_time" gorm:"comment:最后访问时间;column:last_access_time;"`       //最后访问时间
	StatDate       *time.Time `json:"stat_date" form:"stat_date" gorm:"index;comment:统计日期;column:stat_date;" binding:"required"`     //统计日期
	IsActive       *bool      `json:"is_active" form:"is_active" gorm:"default:false;comment:是否活跃用户;column:is_active;"`              //是否活跃
	CreatedBy      uint       `gorm:"column:created_by;comment:创建者"`
	UpdatedBy      uint       `gorm:"column:updated_by;comment:更新者"`
	DeletedBy      uint       `gorm:"column:deleted_by;comment:删除者"`
}

// TableName 插件使用统计 PluginUsageStats自定义表名 plugin_usage_stats
func (PluginUsageStats) TableName() string {
	return "plugin_usage_stats"
}
